@model Omu.AwesomeDemo.Infra.Dto.AjaxDropdownDemoInput
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "index";
}
<h2>
    ajax dropdown demo</h2>
<div class="big">
    <p class="ui-state-highlight">
        all these dropdowns are loaded via ajax on document.ready</p>
    @using (Html.BeginForm())
    {
        <div class="efield">
            <label for="Country">
                Country * :</label>
            @Html.AjaxDropdown("Country", htmlAttributes: new { style = "color:green;" }, parameters: new Dictionary<string, object> { { "jora", "cardan" }, { "k", "val" } })
            @Html.ValidationMessageFor(o => o.Country)
        </div>
        <div class="efield">
            <label for="VCountry">
                Viewdata Country:</label>
            @Html.AjaxDropdown("VCountry", controller: "CountryAjaxDropdown")
        </div>
        @Html.EditorFor(o => o.Hobby)
        @Html.EditorFor(o => o.HobbyGuid)
        
        <div class="efield">
            <label for="Hobbies">
                Hobbies:</label>
            @Html.Lookup("Hobbies", controller: "HobbyLookup", multiselect: true)
        </div>        
        
        <div class="efield">
            <label for="Hombre">
                Person:</label>
            @Html.AjaxDropdown("Hombre", controller: "PersonAjaxDropdown", data: new Dictionary<string, string> { { "Country", "country" }, { "Hobbies", "hobbeez" } })
        </div>
        
        @Html.Example("people that are from the selected <b>Country</b> and don't have any of the selected <b>Hobbies</b>");
        <fieldset class="cbt">
            <legend>Bound dropdowns by parentId</legend>
            <div class="efield">
                <label for="Show">
                    Show:</label>
                @Html.AjaxDropdownFor(o => o.Show)
            </div>
            @Html.Example("try selecting different values and see what's gonna happen with the dropdowns below")
            @Html.EditorFor(o => o.Character)
            @Html.Example("the list of items depends on the value of Show")
            <div class="efield">
                <label for="HobbyX">
                    HobbyX:</label>
                @Html.AjaxDropdown("HobbyX", parentId: "Character")
            </div>
            @Html.Example("the list of items depends on the value of Character")
        </fieldset>
        @Html.EditorFor(o => o.CharsFriends)
        @Html.Example("sending additional parameters via AwesomeParameters attribute")
        @Html.EditorFor(o => o.CharsSouthPark)
        @Html.Example("sending additional parameters via AwesomeParameters attribute")

        @Html.Example("* HobbyX is not in the ViewModel so it's value is not going to be sent back after submit")
        <div class="efield">
            <label>
                post values and send them back</label>
            <input type="submit" value="submit" />
        </div>
    }
</div>
